package org.songyc5.erauka.client;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Objects;

/**
 * Created by songyc5 on 12/02/2018
 */
@EnableConfigurationProperties(PersonProperties.class)
@RestController
public class PersonController {

    @Resource
    private PersonProperties personProperties;

    @GetMapping("person")
    public String person() {
        if (Objects.nonNull(personProperties)) {
            return personProperties.toString();
        }
        return "读不到资源'person.*',检查仓库是否配置错误.";
    }
}
